# vim: set fileencoding=utf-8 :

import paths

class Template(object):


    def __init__(self):
        self._master = read_template('master.tpl')
        self._tableview = read_template('table_view.tpl')
        self._orderview = read_template('customer/order.tpl')
        

    def getMaster(self):
        return self._master
    
    master = property(getMaster,None,"Get für Mastertemplate")
    
    def getTableView(self):
        return self._tableview
    
    tableview = property(getTableView,None,"Get für Tabletemplate")
    
    def getOrder(self):
        return self._orderview
    
    orderview = property(getOrder,None,"Get für Ordertemplate")


def read_template(name,path=None):
    if path == None:
        return file(paths.TEMPLATE_PATH + '/' + name).read()
    else:
        return file(path + '/' + name).read()        